﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarriorRush.GameDynamics.SpecialAbilities
{
    public class Cleave : SpecialAbility
    {
       
        public Cleave() : base()
        {
            AbilityType = AbilityTypes.Cleave;
            Targets = new List<SimplePoint> { new SimplePoint(0, 1), new SimplePoint(0, -1) };
        }
        public override bool Execute(CharacterClass rushTarget, Arena arena, List<CharacterClass> additonalTargets)
        {
            var targets = arena.GetTargetedSpaces(rushTarget.Square, Targets, true);
            foreach (var target in targets)
            {
               
                target.Character.TakeDamage(Power);

            }
            return true;
        }

        public override SpecialAbility GetInstance(int power)
        {

            return new Cleave() { 
                Power = power, 
                ReplacesAttack = this.ReplacesAttack, 
                ShortName = ShortName, 
                Description = Description };

        }

    }
}
